<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       
        * {
            margin: 0;
            padding: 0;
        }

        .hezi {
            width: 200px;
            height: 300px;
            margin: 200px 200px;
            position: relative;
            background-image: url(京东.png);
        }
        .wz {
            width: 150px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            color: #fff;
            font-size: 30px;
            font-weight: 900;
            position: absolute;
            left: 25px;
            top: 30px;
        }
        .xs {
            left: 30px;
            position: absolute;
            top: 230px;
            color: #fff;
            font-size: 20px;
            text-align: center;
            line-height: 40px;
            width: 32px;
            height: 32px;
            background: #2f3430;
        }

        .xz {
            font-size: 18px;
            position: absolute;
            text-align: center;
            padding-top: 185px;
            padding-left: 30px;
            color: #fff;
            font-weight: 900;
        }

       
        .mh1 {
            left: 68px;
            color: #fff;
            font-size: 20px;
            font-weight: 900;
            position: absolute;
            bottom: 70px;
            top: 230px;
        }

        .fz {
            left: 90px;
            position: absolute;
            top: 230px;
            color: #fff;
            font-size: 20px;
            text-align: center;
            line-height: 40px;
            width: 32px;
            height: 32px;
            background: #2f3430;
        }

        .mh2 {
            right: 68px;
            color: #fff;
            font-size: 20px;
            font-weight: 900;
            position: absolute;
            bottom: 70px;
            top: 230px;
        }

        .miao {
            left: 150px;
            position: absolute;
            top: 230px;
            color: #fff;
            font-size: 20px;
            text-align: center;
            line-height: 40px;
            width: 32px;
            height: 32px;
            background: #2f3430;
        }
    </style>
</head>
<body>
    <div class="hezi">
        <div class="wz">京东秒杀</div>
        <div class="xz">10:00点场 距结束</div>
        <div class="xs"></div>
        <div class="mh1">:</div>
        <div class="mh2">:</div>
        <div class="miao"></div>
        <div class="fz"></div>
       
    </div>
    <script>
        var xiaoshi = document.querySelector('.xs');
        var fenzhong = document.querySelector('.fz');
        var miao = document.querySelector('.miao');
        var inputTime = +new Date('2021-6-13 20:00:00');
        countDown();
        setInterval(countDown, 1000);
        function countDown() {
            var nowTime = +new Date();
            var times = (inputTime - nowTime) / 1000;
            var h = parseInt(times / 60 / 60 % 24);
            h = h < 10 ? '0' + h : h;
            xiaoshi.innerHTML = h;
            var m = parseInt(times / 60 % 60);
            m = m < 10 ? '0' + m : m;
            fenzhong.innerHTML = m;
            var s = parseInt(times % 60);
            s = s < 10 ? '0' + s : s;
            miao.innerHTML = s;
        }

    </script>
    
</body>
</html>